package zsc.ruanc.practicaltraining.service;

import zsc.ruanc.practicaltraining.model.domain.TComment;
import zsc.ruanc.practicaltraining.model.domain.TReply;
import zsc.ruanc.practicaltraining.model.vo.CommentVo;

import java.util.List;
import java.util.Map;

/**
 * 评论 + 回复模块
 */
public interface CommentService {

    /**
     *  插入一条评论
     * @param vo
     * @param
     * @return
     */
    public int insertComment(TComment vo, String name, String ip);

    /**
     * 删除一条评论
     * @param commentId
     * @param
     * @return
     */
    public boolean deleteComment(int commentId, String author);

    public boolean updateComment(TComment vo, String author, String ip);

    /**
     * 分页 查询评论 包括评论的回复
     * @param cur
     * @param size
     * @param articleId
     * @return
     */
    public Map selectPage(int cur, int size, int articleId, boolean flag);

    /**
     * 管理员管理评论
     * @param cur
     * @param size
     * @return
     */
    public Map adminSelectPage(int cur, int size);

    /**
     * 为评论点赞
     * @param commentId
     * @return
     */
    public boolean likesAndOneComment(int commentId);
    public boolean likesCutOneComment(int commentId);


    //-------回复功能----------------------

    /**
     *  插入一条评论
     * @param vo
     * @param fromName
     * @param ip
     * @return
     */
    public int insertReply(TReply vo, String fromName, String ip);

    /**
     * 删除一条评论
     * @param id
     * @param author
     * @return
     */
    public boolean deleteReply(int id, String author);

    /**
     * 点赞 | 取消
     * @param replyId
     * @return
     */
    public boolean likesAndOneReply(int replyId);
    public boolean likesCutOneReply(int replyId);



}
